<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">

    <title>Dynamic Table</title>


    <link href="/public/js/iCheck/skins/minimal/blue.css" rel="stylesheet">

    <!--dynamic table-->
    <link href="/public/js/advanced-datatable/css/demo_page.css" rel="stylesheet" />
    <link href="/public/js/advanced-datatable/css/demo_table.css" rel="stylesheet" />
    <link rel="stylesheet" href="/public/js/data-tables/DT_bootstrap.css" />
    <?php $this->load->view('library/header');?>
    <style type="text/css">
        .out-supp-list li {
            padding-bottom: 20px;
            color: #65CEA7;
        }
        .zu-out p {
            font-size: 11px; color: #ff3044; margin: 0;
        }
    </style>
</head>
<body class="sticky-header">

<section>

    <?php $this->load->view('library/left');?>

    <!-- main content start-->
    <div class="main-content" >

        <?php $this->load->view('library/top');?>

        <!--body wrapper start-->
        <div class="wrapper">
            <div class="row">
                <div class="col-sm-12">
                    <?php $this->load->view('library/search');?>
                    <div class="out-sct">

                    </div>
                    <section class="panel">
                        <div class="panel-body">
                            <div class="adv-table">
                                <table class="display table table-bordered table-striped" id="dynamic-table">
                                    <thead>
                                    <tr>
                                        <th width="3%">编号</th>
                                        <th width="6%">图片</th>
                                        <th width="10%" class="center hidden-phone">货号</th>
                                        <th width="15%" class="hidden-phone">链接</th>
                                        <th width="8%" class="hidden-phone">添加时间</th>
                                        <th width="5%" class="hidden-phone">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php if($goods_list){?>
	                                        <tr class="gradeX">
	                                            <td><?php echo $goods_list['id'];?></td>
	                                            <td><img style="width: 100px;" src="<?php echo $goods_list['baby_goods_img'];?>" /></td>
	                                            <td class="up-jia"><?php echo $goods_list['baby_goods_sn'];?></td>
	                                            <td class="hidden-phone"><?php echo $goods_list['baby_goods_link'];?></td>
	                                            <td class="center hidden-phone"><?php echo date('Y-m-d', $goods_list['baby_add_time']);?></td>
	                                            <td class="hidden-phone">
													<a class="btn btn-xs btn-info off_shelve" href="#myModal" data-is="1" data-id="<?php echo $goods_list['id']; ?>" data-toggle="modal"  >下架</a>
	                                            </td>
	                                        </tr>
                                    <?php }?>
                                    
                                    </tbody>
                                </table>
                            </div>
                            <div class="row-fluid">
                                <div class="span6">
                                    <div class="dataTables_paginate paging_bootstrap pagination">
                                        <ul>
                                            <?php echo $pages;?>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>

        <!--body wrapper end-->

        <!--footer section start-->
        <footer>
            2014 &copy; AdminEx by
        </footer>
        <!--footer section end-->


    </div>
    <!-- main content end-->
</section>
<?php $this->load->view('library/footer');?>
<!--icheck -->
<script src="/public/js/iCheck/jquery.icheck.js"></script>
<script src="/public/js/icheck-init.js"></script>

<script type="text/javascript">
    //e仓商品规格图片更新
    $ ('.off_shelve').click (function () {
        var _this = $ (this);
        swal ({
            title: '下架商品',
            showCancelButton: true,
            preConfirm: function preConfirm(value) {
                var goods_id = _this.data ('id');
                swal ({
                    imageUrl: '/public/images/Forrest.gif',
                    title: '稍等...',
                    allowOutsideClick: false,
                    showConfirmButton: false
                });
                return $.post ("<?php echo base_url('Baby/pets_goods_shelf');?>", {goods_id: goods_id}, function (data) {
                    return data;
                }, 'json');
            }
        }).then (function (result) {
            if (result.value) {
                var data = result.value;
                swal ({
                    type: data.status,
                    title: data.info
                }).then (function (isConfirm) {
                    location.reload ();
                });
            }
        });
    });

</script>
<script src="/public/js/scripts.js"></script>

</body>
</html>
